#ifndef _DLOGGER_H
#define _DLOGGER_H

//==============================================================================
//
//         DLogger - the protocol for classes that implement a logger
//
//               Copyright (C) 2004  Dick van Oudheusden
//  
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public
// License along with this program; if not, write to the Free
// Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
//==============================================================================
// 
//  $Date: 2004-11-23 20:06:33 $ $Revision: 1.2 $
//
//==============================================================================


#define DLOG_UNKNOWN  (0)
#define DLOG_PANIC    (128)
#define DLOG_ALERT    (64)
#define DLOG_CRITICAL (32)
#define DLOG_ERROR    (16)
#define DLOG_WARNING  (8)
#define DLOG_NOTICE   (4)
#define DLOG_INFO     (2)
#define DLOG_DEBUG    (1)


//
// The DLogger protocol specifies methods for classes that can perform logging.
// This is done by logging of events. Every event has a level (DLOG_PANIC..) and
// a message. To prevent logging of massive amounts of events, the logger can
// mask events with a certain level(s).
// 


@protocol DLogger

//
// Log an event by the logger
// 
// @param level      the level of the event
// @param message    the message to be logged
// 
// @return success
// 
- (BOOL) doLog :(int) level :(const char *) message;

//
// Set the level mask 
// 
// @param level      the levels (ored)
// 
// @return the previous mask
// 
- (int) mask :(unsigned) levels;

//
// Set the level mask range
// 
// @param high        the highest level to mask
// @param low         the lowest level to mask
// 
// @return the previous mask
//
- (int) mask :(unsigned) high :(unsigned) low;

@end

#endif

